package it.irondev.appturismo.dao;

import it.irondev.appturismo.dao.example.EventstypeExample;
import it.irondev.appturismo.dao.provider.EventstypeSqlProvider;
import it.irondev.appturismo.entity.Eventstype;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface EventstypeMapper {
    @SelectProvider(type=EventstypeSqlProvider.class, method="countByExample")
    int countByExample(EventstypeExample example);

    @DeleteProvider(type=EventstypeSqlProvider.class, method="deleteByExample")
    int deleteByExample(EventstypeExample example);

    @Delete({
        "delete from EventsType",
        "where idEventsType = #{ideventstype,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer ideventstype);

    @Insert({
        "insert into EventsType (idEventsType, name, ",
        "description)",
        "values (#{ideventstype,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{description,jdbcType=VARCHAR})"
    })
    int insert(Eventstype record);

    @InsertProvider(type=EventstypeSqlProvider.class, method="insertSelective")
    int insertSelective(Eventstype record);

    @SelectProvider(type=EventstypeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="idEventsType", property="ideventstype", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR)
    })
    List<Eventstype> selectByExample(EventstypeExample example);

    @Select({
        "select",
        "idEventsType, name, description",
        "from EventsType",
        "where idEventsType = #{ideventstype,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="idEventsType", property="ideventstype", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR)
    })
    Eventstype selectByPrimaryKey(Integer ideventstype);

    @UpdateProvider(type=EventstypeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Eventstype record, @Param("example") EventstypeExample example);

    @UpdateProvider(type=EventstypeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Eventstype record, @Param("example") EventstypeExample example);

    @UpdateProvider(type=EventstypeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Eventstype record);

    @Update({
        "update EventsType",
        "set name = #{name,jdbcType=VARCHAR},",
          "description = #{description,jdbcType=VARCHAR}",
        "where idEventsType = #{ideventstype,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Eventstype record);
}